const state = {
  symbol: null,
  sign: '',
  file: '',
  fileSize: '',
  fileName: '',
  base64: '',
  imageState: false
}
const getters = {
  getBaseImg(state) {
    return state.baseImg
  }
}
const actions = {
  storeFile({
    commit
  }, payload) {
    commit('storeFile', payload)
  },
  storeSymbol({
    commit
  }, payload) {
    commit('storeSymbol', payload)
  },
  showCutImage({
    commit
  }, payload) {
    commit('showCutImage', payload)
  },
  hideCutImage({
    commit
  }, payload) {
    commit('hideCutImage', payload)
  }
}
const mutations = {
  storeFile(state, payload) {
    state.file = payload.file
  },
  storeSymbol(state, payload) {
    state.symbol = payload.symbol
  },
  showCutImage(state, payload) {
    state.imageState = true
    state.base64 = payload.base64
    state.sign = payload.sign
    state.fileSize = payload.fileSize
    state.fileName = payload.fileName
  },
  hideCutImage(state, payload) {
    state.imageState = false
    if (payload && payload.base64) {
      state.base64 = payload.base64
    }
  }
}
export default {
  state,
  actions,
  mutations,
  getters
}
